<?php
/**
 * Created by PhpStorm.
 * User: 29639
 * Date: 2020/5/2
 * Time: 18:02
 */

namespace app\controller;

use app\BaseController;

class Demo extends BaseController
{
    public function show(){
        $result =[
          'status' => 1,
            "message" => "ok",
          'result' => [
              'id' => '1',
              'name' => 'lijian',
              'sex' => '男',
          ]
        ];
        $header =[
          "Token" => "dasfas",
        ];
        return json($result,$code = 201,$header);
    }

    public function request(){
        //第一种获取参数的方法
        dump($this->request->param("abc",1,"intval"));
    }
}